home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / SICL / data1.cab / sicl32 / vb / samples / misc / ser_dev.bas < prev    next >
Encoding:
BASIC Source File  |  2001-03-02  |  810 b   |  35 lines

  1.  
  2. '  ser_dev.bas
  3. '  This example program takes a measurement from a DVM using a
  4. '  SICL device session.
  5. Sub Main ()
  6.    Dim dvm As Integer
  7.    Dim res As Double
  8.    Dim argcount As Integer
  9.  
  10.    ' Open the multimeter session
  11.    dvm = iopen("COM1,488")
  12.    Call itimeout(dvm, 10000)
  13.  
  14.    ' Prepare the multimeter for measurements
  15.    argcount = ivprintf(dvm, "*RST" + Chr$(10), 0&)
  16.    argcount = ivprintf(dvm, "SYST:REM" + Chr$(10), 0&)
  17.  
  18.    ' Take a measurement
  19.    argcount = ivprintf(dvm, "MEAS:VOLT:DC?" + Chr$(10))
  20.  
  21.    ' Read the results
  22.    argcount = ivscanf(dvm, "%lf", res)
  23.  
  24.    ' Print the results
  25.    MsgBox "Result is " + Format(res), MB_ICON_EXCLAMATION
  26.  
  27.    ' Close the multimeter session
  28.    Call iclose(dvm)
  29.  
  30. '  Tell SICL to cleanup for this task
  31.    Call siclcleanup
  32.  
  33. End Sub
  34.  
  35.